//
//  VCMusicListTableViewCell.m
//  VideoCollage
//
//  Created by Mac on 2018/6/25.
//  Copyright © 2018年 stoneobs.qq.com. All rights reserved.
//

#import "VCMusicListTableViewCell.h"

@interface  VCMusicListTableViewCell()

@end
@implementation VCMusicListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self configSubView];
    }
    return self;
}
+ (CGFloat)cellHeight{
    return 55;
}
#pragma mark --subView
- (void)configSubView{
    UIView * whiteView = [[UIView alloc] initWithFrame:CGRectMake(15, 0, UIScreenWidth - 30, self.class.cellHeight)];
    whiteView.layer.cornerRadius = 4;
    whiteView.clipsToBounds = YES;
    [self addSubview:whiteView];
    
    self.nameLable = [[STLabel alloc] initWithFrame:CGRectMake(10, 0, whiteView.width - 20, whiteView.height)
                                                     text:@""
                                                textColor:[UIColor colorWithRed:195/255.0 green:203/255.0  blue:216/255.0  alpha:1]
                                                     font:15
                                              isSizetoFit:NO
                                            textAlignment:NSTextAlignmentLeft];
    [whiteView addSubview:self.nameLable];
    
    
    self.itemButton = [[STButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)
                                                     title:nil
                                                titleColor:nil
                                                 titleFont:0
                                              cornerRadius:0
                                           backgroundColor:nil
                                           backgroundImage:nil
                                                     image:[UIImage imageNamed:@"play"]];
    [self.itemButton setImage:[UIImage imageNamed:@"use"] forState:UIControlStateSelected];
    [whiteView addSubview:self.itemButton];
    self.itemButton.right = whiteView.width ;
    self.itemButton.centerY = whiteView.height/2;
    self.itemButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentCenter;
}
- (void)setModel:(VCMusicModel *)model{
    _model = model;
    self.nameLable.text = model.name;
    self.itemButton.selected = model.isSlected;
}
@end
